package how2quit.apps.kleague;

import android.app.Dialog;
import android.content.Context;
import android.view.ViewGroup.LayoutParams;
import android.widget.ProgressBar;

public class LoadingDialog {
	private static Dialog loadingDialog = null;
	public static void showLoadingDialog(Context context){
		if(loadingDialog==null){
			loadingDialog = new Dialog(context, R.style.loadingDialog);
			ProgressBar progressBar = new ProgressBar(context);
			LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
			loadingDialog.addContentView(progressBar, params);
			loadingDialog.setCancelable(false);
		}
	}
	public static void hideLoadingDialog(){
		if(loadingDialog!=null){
			loadingDialog.dismiss();
			loadingDialog = null;
		}
	}
}
